/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.time.LocalDate;

/**
 * <p>Project: jse2303 - Student
 * <p>Powered by webrx On 2023-07-12 14:10:29
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Student implements Comparable<Student> {
    private int id;
    private String name;
    private LocalDate birth;
    private int score;


    //alt+insert 生成
    @Override
    public int compareTo(Student o) {
        // b.score-a.score 成绩降序
        //return o.score - this.score;
        return id - o.id; //根据对象的id升序
    }

    @Override
    public String toString() {
        return "Student{" + "id=" + id + ", name='" + name + '\'' + ", birth=" + birth + ", score=" + score + '}';
    }

    public Student() {
    }

    public Student(int id, String name, LocalDate birth, int score) {
        this.id = id;
        this.name = name;
        this.birth = birth;
        this.score = score;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDate getBirth() {
        return birth;
    }

    public void setBirth(LocalDate birth) {
        this.birth = birth;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }
}
